//
//  WebController.m
//  TravelProject
//
//  Created by lanou3g on 15/11/25.
//  Copyright © 2015年 韩婷婷. All rights reserved.
//

#import "WebController.h"

@interface WebController ()<UIWebViewDelegate>
@property (nonatomic,strong)UIWebView *aWebView;
@end

@implementation WebController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationController.navigationBar.backgroundColor = [UIColor greenColor];
  
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"back.png"] style:UIBarButtonItemStyleDone target:self action:@selector(leftAction:)];
    self.view.backgroundColor = [UIColor redColor];
    self.aWebView = [[UIWebView alloc]initWithFrame:self.view.frame];
    self.aWebView.scalesPageToFit = YES;
    self.aWebView.delegate = self;
    NSURL *url = [NSURL URLWithString:self.urlString];
    [self.aWebView loadRequest:[NSURLRequest requestWithURL:url]];
    [self.view addSubview:self.aWebView];
    // Do any additional setup after loading the view.
}
- (void)leftAction:(UIBarButtonItem *)sender{
    [self.navigationController popViewControllerAnimated:YES];
}
-(BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType{
    return YES;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
